import 'package:flutter/material.dart';
import 'common/router.dart';
import 'package:provider/provider.dart';
import 'pages/theme_notifier.dart';

void main() {
  runApp(
    ChangeNotifierProvider(
      create: (context) => ThemeNotifier(),
      child: MyApp(),
    ),
  );
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final themeNotifier = Provider.of<ThemeNotifier>(context);
    return MaterialApp.router(
      debugShowCheckedModeBanner: false,
      title: "MyEbook",
      theme: ThemeData.light(),
      darkTheme: ThemeData.dark().copyWith(
        scaffoldBackgroundColor: Color(0xFF32383E),
      ),
      themeMode: themeNotifier.themeMode,
      routerConfig: myRouter,
    );
  }
}






